package org.realogic.cfm.authenticate;

import java.io.Serializable;

public class KSessionUser implements Serializable {

	private static final long serialVersionUID = -7587651032156900118L;

	// 用户标识
	private String userID = "";

	// 用户名称
	private String name = "";

	// 组织机构标识
	private String orgID = "1";

	private String orgName = "";

	// 组织部门标识
	private String deptID = "";

	private String deptName = "";

	// 登录代码
	private String loginCode = "";

	// 商家
	private String merchantID = "100001";

	// 用户权限
	private KPermissions permissions;

	// 登录语言
	private String language;

	// 登录风格
	private String theme;

	public KSessionUser() {

	}

	public KSessionUser(String id, String name, String deptID, String deptName, String loginCode) {
		this.userID = id;
		this.name = name;
		this.deptID = deptID;
		this.deptName = deptName;
		this.loginCode = loginCode;
	}

	public String getUserID() {
		return userID;
	}

	public String getLoginCode() {
		return loginCode;
	}

	public String getName() {
		return name;
	}

	public String getDeptID() {
		return deptID;
	}

	public String getDeptName() {
		return deptName;
	}

	public String getOrgName() {
		return orgName;
	}

	public String getOrgID() {
		return orgID;
	}

	public String getMerchantID() {
		return merchantID;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public String getTheme() {
		return theme;
	}

	public void setTheme(String theme) {
		this.theme = theme;
	}

	public KPermissions getPermissions() {
		if (permissions == null) {
			permissions = new KPermissionsImpl();
		}
		return permissions;
	}

	public boolean hasPermission(String permType) {
		if (permissions == null) {
			return false;
		}
		return permissions.hasPermission(permType);
	}
}